<template>
	<view class="container" :style="[containHeight]">
		<view class="menu_content layout-between">
			<view class="menu_item layout-column-center" @click="toSubMenu(1)">
				<image src="../../static/evaluationResults.png" mode="scaleToFill"></image>
				<text>评估结果</text>
			</view>
			<!-- v-if="roleId!='general_user'" -->
			<view class="menu_item layout-column-center" @click="toSubMenu(2)">				
				<image src="../../static/statistic.png" mode="scaleToFill"></image>
				<text>数据统计分析</text>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				fullHeight: true,
				roleId: '',
			}
		},
		onLoad() {
			this.roleId = uni.getStorageSync('userinfo').roleId
		},
		computed: {
			containHeight() {
				return {
					/*#ifdef MP-WEIXIN*/
					// 微信小程序特有代码
					height: this.fullHeight ? '100vh' : 'auto',
					/*#endif*/
					/*#ifndef MP-WEIXIN*/
					height: this.fullHeight ? 'calc(100vh - 44px - 50px)' : 'auto',
					/*#endif*/
					transition: 'all 1s ease'
				}
			}
		},
		onReachBottom() {
			if (this.fullHeight) {
				this.fullHeight = false
			}
		},
		methods: {
			toSubMenu(index) {
				if (index == 1) {
					uni.navigateTo({
						url: '/pages/evaluationReaults/evaResults'
					})
				} else if (index == 2) {
					uni.navigateTo({
						url:'/pages/dataAnalyse/analysePortrait'
					})
				} else {

				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		background: linear-gradient(#BDD7FE 15%, #F6FAFF 100%);
		padding: 20rpx 40rpx;
		width: 100%;
		position: relative;
		box-sizing: border-box;
	}

	.menu_content {
		box-sizing: border-box;
		padding: 20rpx 15rpx;
		width: 100%;
		position: relative;
		background: #ffffff;
		margin-top: 50rpx;
		border-radius: 30rpx;
		box-shadow: 5rpx 0rpx 6rpx 5rpx #fff;

		.menu_item {
			width: 100%;
			margin-top: 10rpx;
			font-size: 30rpx;
			box-sizing: border-box;
			padding: 10rpx 20rpx;

			image {
				display: block;
				width: 80rpx;
				height: 80rpx;
				margin-bottom: 20rpx;
			}
		}
	}
</style>